package com.example.project.projectspringcloud.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BaseEntity implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private Integer id;

    private Integer isDelete = 0;

    private Integer createUser;

    private Date createDate;

    private Integer updateUser;

    private Date updateDate;

    @JsonIgnore
    private boolean newRecord = true;

    /**
     * 查询排序条件, 多个条件用逗号分割
     */
    @JsonIgnore
    private String orderStr;

    /**
     * 查询公用
     */
    @JsonIgnore
    private String searchWord;

    public boolean isNewRecord() {
        return newRecord && id == null;
    }

}
